projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ebb713
)
gdkrgba: Use %g instead of %.17g to print alpha
author
Benjamin Otte
<otte@redhat.com>
Mon, 2 Nov 2015 16:04:39 +0000
(17:04 +0100)
committer
Benjamin Otte
<otte@redhat.com>
Mon, 2 Nov 2015 19:32:12 +0000
(20:32 +0100)
This way 0.3 isn't printed as 0.
29999999999999
gdk/gdkrgba.c
patch
|
blob
|
history
diff --git
a/gdk/gdkrgba.c
b/gdk/gdkrgba.c
index 43195dd37995d9faf464c01e0001f50eab3dc3c2..2a8e09693aa5dc9db80b3a5af9d33cf4347348f3 100644
(file)
--- a/
gdk/gdkrgba.c
+++ b/
gdk/gdkrgba.c
@@
-366,7
+366,7
@@
gdk_rgba_to_string (const GdkRGBA *rgba)
{
gchar alpha[G_ASCII_DTOSTR_BUF_SIZE];
- g_ascii_
dtostr (alpha, G_ASCII_DTOSTR_BUF_SIZE
, CLAMP (rgba->alpha, 0, 1));
+ g_ascii_
formatd (alpha, G_ASCII_DTOSTR_BUF_SIZE, "%g"
, CLAMP (rgba->alpha, 0, 1));
return g_strdup_printf ("rgba(%d,%d,%d,%s)",
(int)(0.5 + CLAMP (rgba->red, 0., 1.) * 255.),